UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fsMMVqLPjOZp37BaoA0JLdNRecP5zz8vCIT3JlLabj4='
WHERE
key_id = 'db4c1a322b7ec844f9374a111fc541c3177215620ddfb19c5f3ee65f737871b9'
AND (
token = 'fsMMVqLPjOZp37BaoA0JLdNRecP5zz8vCIT3JlLabj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)