UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xdfuzpKpsoWSkGLsbFWLoIgJLtBaJchAnODFhfrAPDI='
WHERE
key_id = '6c0ccbaf99cba00d3aa3231a55e85018aa1b193da11049ec2a29bcc46e7fc085'
AND (
token = 'xdfuzpKpsoWSkGLsbFWLoIgJLtBaJchAnODFhfrAPDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)