UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cl7nIUNpovQKUYWKm+EWT9YscAvQwkAKCIgrL2Scx1s='
WHERE
key_id = 'e0617c4b76e764a86191c6148cfbe2d1cedeb86bbada84547cf3a0f787ee2d2d'
AND (
token = 'cl7nIUNpovQKUYWKm+EWT9YscAvQwkAKCIgrL2Scx1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)