UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xQJr+qldvH2L06cqzsa0K4rOjqWebBywUF1PdVhuWo8='
WHERE
key_id = '2bcbf31af2f96326496db6f5a3a3ffc8f3fa1f5e52004a6cf0220f37af8cd974'
AND (
token = 'xQJr+qldvH2L06cqzsa0K4rOjqWebBywUF1PdVhuWo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)