UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lpIu3qxq30jDX//984maJevVaFxWcIfN3U8byXwLcfk='
WHERE
key_id = '24a11f8b958e3c7e4499b8e14fa199acbd3ad0b18a4ea97f84ab47a29df84c43'
AND (
token = 'lpIu3qxq30jDX//984maJevVaFxWcIfN3U8byXwLcfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)