UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TFxOTQtOkEd8gctdPysiCTwu3x9XlFJW1Ta8yWip5RM='
WHERE
key_id = '0cd70570f864cf54b2a1857fce8b0db758fba89d6c0560147ef13c46c3e05a28'
AND (
token = 'TFxOTQtOkEd8gctdPysiCTwu3x9XlFJW1Ta8yWip5RM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)