UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+yDF7CTKb0du69ZSI3dQoON5udSCma9Cm3JXcnSQjkk='
WHERE
key_id = '93697df43df746ecd015575304c527b3f37516412b1bfb00d8c858e8dd50d820'
AND (
token = '+yDF7CTKb0du69ZSI3dQoON5udSCma9Cm3JXcnSQjkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)