UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'matnNm/JupO00xNSb70uOeGAs65+zbohWnlAen9ojNY=' 
WHERE 
  key_id = 'fd414ef09c6839d6376ea2afc2391579bfcba755b5664b88c83009b8f0c99769' 
  AND (
    token = 'matnNm/JupO00xNSb70uOeGAs65+zbohWnlAen9ojNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031