UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nPOXkqZbyqFHml/HEcFeFzniJOTpA1EHRre3ZlxSD/s=' 
WHERE 
  key_id = '7113b50b2e82d8ebbd738bb6e8c060f02e9f59662d5b85b3eda6104c04421a8f' 
  AND (
    token = 'nPOXkqZbyqFHml/HEcFeFzniJOTpA1EHRre3ZlxSD/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039