UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nD3FqkB83qThdyz4YVQRVu4+5GyeipDTXUiG7TEuoPw='
WHERE
key_id = '5d00e0585666972d86b3b543970482fb1faa56929a42b695da279a84ce62e610'
AND (
token = 'nD3FqkB83qThdyz4YVQRVu4+5GyeipDTXUiG7TEuoPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)