UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LJKn5f5a7S3gOc/wUFSFvfija/fbfdzxpuhLKjl7Aoo=' 
WHERE 
  key_id = '21ebd2726ea9660374c64818bcc4d3ef9f53cb3deda9b42bc946f2f9ac2fca7a' 
  AND (
    token = 'LJKn5f5a7S3gOc/wUFSFvfija/fbfdzxpuhLKjl7Aoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044