UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5xgTsvz9l4AOzcgupSvccF9zOWOYSSQd4F9T/ykhAwc='
WHERE
key_id = '868d49aac777cd1524fc63a6c0b3c4a0d36106395c65af605d35dd1823d23af1'
AND (
token = '5xgTsvz9l4AOzcgupSvccF9zOWOYSSQd4F9T/ykhAwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)