UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PV0Lhieoat4iB0cu30Z24KtK3fNZ4aYsq14q4GtJmt4=' 
WHERE 
  key_id = '25a5052cc52fe8987bdf738b9263d7cd59a03d500844bcc61c2bb4d3c0c38859' 
  AND (
    token = 'PV0Lhieoat4iB0cu30Z24KtK3fNZ4aYsq14q4GtJmt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029