UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wPLwxTuxHE44ku241hqPo7wiSoi6LxsC57QGYY5ren8=' 
WHERE 
  key_id = 'ac36426e810b6a3bd381381fe014e3fbf992e7e47e445c0904cedcb830f3c556' 
  AND (
    token = 'wPLwxTuxHE44ku241hqPo7wiSoi6LxsC57QGYY5ren8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040