UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sb+spI8g2Z76eqbuen7f+Dlj+k/LGuqmZBSHtkfmAAY='
WHERE
key_id = '03a383542181ad17aa8ccbff4088d995b3cb456546a76f6f156add52c01fc9e8'
AND (
token = 'sb+spI8g2Z76eqbuen7f+Dlj+k/LGuqmZBSHtkfmAAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)