UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8F6FuxXhd7DXM85GfNlL7r6ZErCPNYiBVZwbiXQ5DZE='
WHERE
key_id = '183994f34a1aa7e9a507fbe9825940164a293196a7c6a14a731c29cc8fdb54a1'
AND (
token = '8F6FuxXhd7DXM85GfNlL7r6ZErCPNYiBVZwbiXQ5DZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)