UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5tuvBvmOBihUiHwcJACCdy3gDiwx9fuohg47rpkiAnY=' 
WHERE 
  key_id = 'b72e1b68252218f15f1af6bb48ac3b8b21ec2973de44b7efa1606de78eb16cf6' 
  AND (
    token = '5tuvBvmOBihUiHwcJACCdy3gDiwx9fuohg47rpkiAnY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034