UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OXxOPx9Uljk50gU8AFtL20bEr9rN6x7IvbtXIGDeoe4='
WHERE
key_id = '5274c8e359829c0c74f8ab19e5c8842bc51f31fa5c569132cf89326f48993db1'
AND (
token = 'OXxOPx9Uljk50gU8AFtL20bEr9rN6x7IvbtXIGDeoe4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)