UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'igwmoJ2Z+NXpdvIdBkQ0w4RT2FSAQKfEvmQA9uDUgAY='
WHERE
key_id = '2011c2e6f91d1ebc3a76c1e5f9129577d8fd78b188d55ace10c086af251ebb41'
AND (
token = 'igwmoJ2Z+NXpdvIdBkQ0w4RT2FSAQKfEvmQA9uDUgAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)