UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4GIo1l/Cu/uy74Vs19uXxdsGavKhQ2Gebcw4JZfxFAA='
WHERE
key_id = 'e1e2d9d57cdf3f75be1dba8fd786edfcbf4aecf21f9bd70a55af0a09e0ed925d'
AND (
token = '4GIo1l/Cu/uy74Vs19uXxdsGavKhQ2Gebcw4JZfxFAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)