UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '135AwKq1SYR9yg0cp7ZEkVb8b4OHNAfNIpLXqBXVuqI='
WHERE
key_id = '8f8c98e60fef62c521a89e04c18ce7951ba72002e8d61c1919144c71060709ee'
AND (
token = '135AwKq1SYR9yg0cp7ZEkVb8b4OHNAfNIpLXqBXVuqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)