UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mFChsKHEN2UXkQkRWQZjE44Rew9TjR5XKm6k8N9+jmo='
WHERE
key_id = '6b6a128e5aa2369ec779ab293b308682619e6d634f56e385fd327834432b3153'
AND (
token = 'mFChsKHEN2UXkQkRWQZjE44Rew9TjR5XKm6k8N9+jmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)