UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OybLA7qCkaFZM2QHhbc+dNPiCgkQrjK7Xjy3xm9EIXg='
WHERE
key_id = '4bcb54a68d063bb0b51d6d05f2a5e8699e0c625157e9e967c9b30b93485d2e5c'
AND (
token = 'OybLA7qCkaFZM2QHhbc+dNPiCgkQrjK7Xjy3xm9EIXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)