UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+2PFxs2d9dAQCVbqlStpT6uj1DDMsqCK4fIKudeUYhw='
WHERE
key_id = '391f287ea3c02802fcf8fd1dda757fb9b93d431d3e308bf2ea62fbbeeb70a2f5'
AND (
token = '+2PFxs2d9dAQCVbqlStpT6uj1DDMsqCK4fIKudeUYhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)