UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lsUetoWKtbBdrluLLGglsd55MIBXu+dW0NXcZDFessA='
WHERE
key_id = '12de5387910c14799607de3addc8c12fb803e9707e69b8144674ced1687b8438'
AND (
token = 'lsUetoWKtbBdrluLLGglsd55MIBXu+dW0NXcZDFessA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)