UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mr95VQT2b9pScJzfE8QqLG+fgb5m5Ma2OPkl5thqLAM=' 
WHERE 
  key_id = '757324e13c0251893d68b9004f5b460d58a7c3450b24e7c72e1c28629abfdae8' 
  AND (
    token = 'mr95VQT2b9pScJzfE8QqLG+fgb5m5Ma2OPkl5thqLAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031