UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3bEoEoj8LtmdSiE3Kej41kUDK6NRToToJK+LQQIGd4Q='
WHERE
key_id = '3539a6783b617d2a58c05c8dabb64bfa84f246f689087d2803a0d3544d1a9ce6'
AND (
token = '3bEoEoj8LtmdSiE3Kej41kUDK6NRToToJK+LQQIGd4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)