UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kh9So+yGR4RR45y8FfbQdtk1fOSU6ApneMZ6M8amQMo=' 
WHERE 
  key_id = '68e20cfa377451c6da7738fa69a43d1c16a493b54e54a6e2e2897b3c4c3dcb06' 
  AND (
    token = 'kh9So+yGR4RR45y8FfbQdtk1fOSU6ApneMZ6M8amQMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050