UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zlb1SfpNb5Z3rxm/bsvNAPQnlso+KjM3r2SnCz7yNjM='
WHERE
key_id = '0a331ef90f0d44d1e86fcf54d4c84da6bcd79da48966f2729fdbc2547ca575af'
AND (
token = 'zlb1SfpNb5Z3rxm/bsvNAPQnlso+KjM3r2SnCz7yNjM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)