UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SGS3vNOvACaQA4LZ/vGEfmxamvbJawtCWe7PptJaltg=' 
WHERE 
  key_id = 'ea2c3ab827cf452b73bba1a2abcb18fab3dd6bba22f662e46f606b35673c4443' 
  AND (
    token = 'SGS3vNOvACaQA4LZ/vGEfmxamvbJawtCWe7PptJaltg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019